<template>
  <div class="updatePrice">
    <el-dialog :visible.sync="showDialog" :close-on-click-modal="false" title="支付凭证" width="600px">
      <div>
        <el-image :src="options.uploadVoucher" :preview-src-list="[options.uploadVoucher]" />
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button type="primary" :loading="loading" @click="updateStateById">通过</el-button>
        <el-button @click="close">取消</el-button>
      </span>
    </el-dialog>
  </div>
</template>

<script>
//
import { updateStateById } from '@/api/order'
export default {
  props: {
    showDialog: {
      type: Boolean,
      default: false
    },
    options: { // 浮现距离
      type: Object,
      default: () => { }
    },

  },
  data () {
    return {
      loading: false,
      visible: false
    };
  },
  methods: {
    async updateStateById () {
      this.loading = true
      const res = await updateStateById({
        state: 2,
        orderId: this.options.orderId
      })
      console.log(res, 'updateStateById')
      if (res) {
        this.$message({
          message: '审核通过',
          type: 'success'
        })
        this.close()
      }
      this.loading = false
    },
    close () {
      this.$emit('close')
    },

  },
};
</script>

<style lang="scss">

</style>
